Device model needs to do xm destroy before it exits on
guest shutdown/poweroff/halt -p.
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
}
}
+extern void destroy_vmx_domain(void);
static void do_quit(void)
{
- extern int domid;
- extern FILE* logfile;
- char destroy_cmd[20];
- sprintf(destroy_cmd, "xm destroy %d", domid);
- if (system(destroy_cmd) == -1)
- fprintf(logfile, "%s failed.!\n", destroy_cmd);
+ destroy_vmx_domain();
exit(0);
}
env->send_event = 1;
}
-//static unsigned long tsc_per_tick = 1; /* XXX: calibrate */
+void
+destroy_vmx_domain(void)
+{
+ extern int domid;
+ extern FILE* logfile;
+ char destroy_cmd[20];
+ sprintf(destroy_cmd, "xm destroy %d", domid);
+ if (system(destroy_cmd) == -1)
+ fprintf(logfile, "%s failed.!\n", destroy_cmd);
+}
int main_loop(void)
{
}
}
}
+ destroy_vmx_domain();
return 0;
}